package swing.frame.whiteboard;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class TextEditDialog extends JDialog {

    JTextField textField = new JTextField();

    static private TextEditDialog textEditDialog = new TextEditDialog();

    static public TextEditDialog getEdit(){
        return textEditDialog;
    }
    private TextEditDialog() {
        textField.setBorder(null);
        textField.setEditable(true);


        this.add(textField);
        this.setUndecorated(true);
        this.setBackground(new Color(0,0,0,0));
        textField.setBackground(new Color(0,0,0,0));
        textField.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                TextEditDialog.this.dispose();
            }
        });
    }

}
